package com.example.sportzbreak;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class GetSetActivity extends Activity {
	
	private CountDownTimer countDownTimer;
	private boolean timerHasStarted = false;
	public TextView text;
	private final long startTime = 4 * 1000;
	private final long interval = 1 * 1000;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.get_set_activity);

		text = (TextView) this.findViewById(R.id.timer);
		
		countDownTimer = new MyCountDownTimer(startTime, interval);
		
		text.setTextColor(Color.BLACK);
		text.setText(text.getText() + String.valueOf(startTime / 1000));
		
		countDownTimer.start();
		timerHasStarted = true;
		
		
	}

	 
	public class MyCountDownTimer extends CountDownTimer {
		public MyCountDownTimer(long startTime, long interval) {
			super(startTime, interval);
	}
	
	@Override
	public void onFinish() {
		text.setText("Go!");
	}

	@Override
	public void onTick(long millisUntilFinished) {
		text.setText("" + millisUntilFinished / 1000);
	}
}
	
	
}
